import {
  getAction,
  postFormData,
  putAction,
  postAction,
  uploadAction
} from '@/api/manage'
const gateway = '/api/gateway/jic-backend-mall'
const baseUrl = window._CONFIG['domianURL'] || '/jeecg-boot'


export const politeList = (params) => postAction(gateway + `/mall/polite/list`, params) // 荐客有礼列表
export const getNumber = () => getAction(gateway + `/mall/polite/number`) // 荐客有礼列表数量
export const operation = (id, type) => getAction(gateway + `/mall/polite/operation?id=${id}&type=${type}`) // 删除  下线

export const promote = (id, url) => getAction(gateway + `/mall/polite/promote?url=${url}&weid=${id}`) //列表投放

export const storeDelete = (id) => getAction(gateway + `/mall/polite/storesDel?id=${id}`) // 门店删除
export const storeList = (params) => postAction(gateway + `/mall/polite/stores`, params) // 门店列表   
export const packageInit = () => getAction(gateway + `/mall/polite/packageInit`) //人群包列表 
export const vipGroupId = (params) => postAction(gateway + `/mall/polite/vipGroupId`, params) //新增人群包
export const queryPeoPle = (id) => getAction(gateway + `/mall/polite/queryPeoPle?groupId=${id}`) // 人群包查询 
export const downloadQrCode = (url) => getAction(gateway + `/mall/polite/downloadQrCode?url=${url}`) //下载图片 

export const storeImport = (params) => uploadAction(gateway + `/mall/polite/import`, params) // 门店导入 
export const errorTemplate = baseUrl + gateway + `/mall/polite/errorTemplate` // 话题内容导出
export const queryTemplate = (groupId) => getAction(gateway + `/mall/polite/queryTemplate?groupId=${groupId}`) // 门店导入失败接口返回值

export const storeExport = () => getAction(gateway + `/mall/polite/export`) // 下载模版
export const lvlGroup = (params) => postAction(gateway + `/mall/polite/lvlGroup`, params) //集团卡等级
export const lvlGroupId = (id) => getAction(gateway + `/mall/polite/lvlGroupList?lvlGroupId=${id}`) // 集团查询
export const contentExport = baseUrl + gateway + `/mall/polite/exportDetail` // 话题内容导出
export const politeUpdate = (params) => getAction(gateway + `/mall/polite/politeUpdate?id=${params.id}&type=${params.type}`) // 集团 门店删除


export const exportDetail = (params) => getAction(gateway + `/mall/polite/exportDetail?id=${params.id}&ruleType=${params.ruleType}`) // 详情导入
export const politeActivity = (params) => postAction(gateway + `/mall/polite/activity`, params) // 荐客有礼新增  复制
export const politeDetail = (id) => getAction(gateway + `/mall/polite/details?id=${id}`) // 荐客有礼详情
export const getEventDetail = (params) => postAction(gateway + `/mall/polite/eventDetails`, params) // 活动明细
export const couponsDel = (id) => getAction(gateway + `/mall/polite/couponsDel?id=${id}`) // 奖励条件删除